package com.eg.egent.example;

import com.alibaba.fastjson.JSONObject;
import com.eg.egent.example.common.ApiUtil;
import com.eg.egent.example.common.Constants;

/**
 * 查看下行指令的详细信息
 * @author geliangjian
 *
 */
public class GetTaskDetailExample {
	
	private static Integer encrypt = Constants.ENCRYPT_NO;

	private static Integer signMethod = Constants.SIGN_METHOD_HMAC;
	
	private static String taskDesc = "查看下行指令详细信息";

	public static void main(String[] args) {
		
		String taskId = "58324f8cbab4a8db1b106bc3";// 服务端返回的下行指令ID
		String taskDetail = ApiUtil.getTaskDetail(taskId, encrypt, signMethod);
		JSONObject taskDetailObject = JSONObject.parseObject(taskDetail);
		JSONObject taskDetailData = taskDetailObject.getJSONObject("data");
		ApiUtil.showTaskStatus(taskDetailData, taskDesc);

	}

}
